package engine.asset
{
	import com.adobe.utils.*;
	import engine.core.*;
	import engine.loaders.*;
	import flash.display3D.*;
	import flash.utils.*;
	
	public class RxAssetShader extends RxAsset
	{
		private var m_fragmentMicrocode:ByteArray;
		private var m_vertexMicrocode:ByteArray;
		private var m_fragmentLoader:RxLoader;
		private var m_vertexLoader:RxLoader;
		private var m_loaderType:int;
		private static var s_type:int;
		
		public function RxAssetShader()
		{
			super(s_type);
			this.m_fragmentMicrocode = null;
			this.m_vertexMicrocode = null;
			this.m_loaderType = RxLoader.TYPE_TEXT;
			m_size = 0;
		}
		
		public static function Initialize() : void
		{
			s_type = RxAsset.RegisterType("shader", CreateFromXML);
		}
		
		public static function CreateFromXML(xml:XML, info:String) : RxAssetShader
		{
			var name:* = xml.@name;
			var url:* = xml.@url;
			url = RxUtilities.MergePath(info, url);
			return Create(url, name);
		}
		
		public static function Create(url:String, name:String) : RxAssetShader
		{
			var _loc_3:* = GetByURL(url);
			if (_loc_3 != null)
			{
				var _loc_4:* = _loc_3;
				var _loc_5:* = _loc_3.m_references + 1;
				_loc_4.m_references = _loc_5;
				return _loc_3;
			}
			_loc_3 = new RxAssetShader;
			_loc_3.SetURL(url);
			_loc_3.SetName(name);
			return _loc_3;
		}
		
		public static function GetByURL(param1:String) : RxAssetShader
		{
			return RxAssetShader(_getByURL(param1, s_type));
		}	
	}
}